package dbi.org.model;

public class Record {	
	private String[] columnNames;
	private String[] recordValues;
	
	public Record(String[] columnNames, String[] recordValues) {
		this.recordValues = recordValues;
		this.columnNames = columnNames;
	}

	public String[] getRecordColumnNames() {
		return columnNames;
	}

	public String[] getRecordValues() {
		return recordValues;
	}

	public boolean setNewValues(String[] values) {
		if (recordValues.length == values.length) {
			recordValues = values;
			return true;
		} else
			return false;
	}

	public int columnPosition(String columnName) {
		int counter = 0;
		for (int i = 0; i < columnNames.length; i++) {		
			if (columnName.equals(columnNames[i]))
				return counter;
			else
				counter++;
		}
		return counter;
	}
	



}
